import Vue from 'vue'
import App from './App.vue'
//三级联动组件---全局组件
import TypeNav from '@/components/TypeNav'
import Carousel from '@/components/Carousel'
import Pagination from '@/components/Pagination'
import { Button, MessageBox } from 'element-ui'

Vue.component(TypeNav.name, TypeNav);
Vue.component(Carousel.name, Carousel);
Vue.component(Pagination.name, Pagination);
//element组件的使用
Vue.component(Button.name, Button);
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
import router from '@/router'

import store from '@/store';
//引入mockServe.js
import '@/mock/mockServe.js'
// 引入swiper样式
import 'swiper/css/swiper.css'
// 引入API
import * as API from '@/api'
Vue.config.productionTip = false;

//引入插件,懒加载
import VueLazyload from 'vue-lazyload'
import loadimage from '@/assets/images/1.gif'
Vue.use(VueLazyload, {
    preLoad: 1.3,
    // error: errorimage,
    loading: loadimage,
    attempt: 1
})

//引入表单校验插件
import '@/plugins/validate'
new Vue({
    render: h => h(App),
    beforeCreate() {
        Vue.prototype.$bus = this;
        Vue.prototype.$API = API;
    },
    router,
    store
}).$mount('#app')